﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using TomShane.Neoforce.Controls;

namespace Warlock.Menu
{
    class SingleplayerStartScreen : IGameScreen
    {
        public Game1 MainGame { get; set; }

        Window mainWindow;

        ImageBox mapPreviewImage;

        Button mapLoadButton;
        Button startButton;
        Button backButton;

        Label mapNameLabel;
        Label mapDescriptionLabel;
        Label mapAuthorLabel;

        public void Initialize(Microsoft.Xna.Framework.GraphicsDeviceManager graphics, Microsoft.Xna.Framework.Content.ContentManager content)
        {
            mainWindow = new Window(Game1.Manager);
            mainWindow.Init();
            mainWindow.Text = "";
            mainWindow.Width = graphics.PreferredBackBufferWidth;
            mainWindow.Height = graphics.PreferredBackBufferHeight;
            mainWindow.Left = 0;
            mainWindow.Top = 0;

            mapPreviewImage = new ImageBox(Game1.Manager);
            mapPreviewImage.Init();
            mapPreviewImage.Parent = mainWindow;

            mapNameLabel = new Label(Game1.Manager);
            mapNameLabel.Init();
            mapNameLabel.Parent = mainWindow;

            mapDescriptionLabel = new Label(Game1.Manager);
            mapDescriptionLabel.Init();
            mapDescriptionLabel.Parent = mainWindow;

            mapAuthorLabel = new Label(Game1.Manager);
            mapAuthorLabel.Init();
            mapAuthorLabel.Parent = mainWindow;

            Game1.Manager.Add(mainWindow);
        }

        public void UnloadContent()
        {
            Game1.Manager.Remove(mainWindow);
        }

        public void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            Game1.Manager.Update(gameTime);
        }

        public void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.GameTime gameTime)
        {
            Game1.Manager.Draw(gameTime);
        }
    }
}